home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmigaPlus / Tools / Development / envCPP31 / compilers / sas-c / rexx / lookupgst.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2002-01-01  |  2.5 KB  |  115 lines

  1. /* $VER: 1.1 */
  2.  
  3. options results                             /* enable return codes     */
  4.  
  5. if (left(address(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.  
  7.     address 'GOLDED.1'
  8.  
  9. 'LOCK CURRENT RELEASE=4'                    /* lock GUI, gain access   */
  10.  
  11. if (RC ~= 0) then
  12.  
  13.     exit
  14.  
  15. options failat 6                            /* ignore warnings         */
  16.  
  17. signal on syntax                            /* ensure clean exit       */
  18.  
  19. /* ---------------------- INSERT YOUR CODE HERE ---------------------- */
  20.  
  21. 'QUERY CAT'
  22.  
  23. if (RESULT = "deutsch") then do
  24.  
  25.     STRING.sFILE  = "GST-Datei laden..."
  26.     STRING.sGST   = "Symbol nachschlagen:"
  27.     STRING.sERROR = "GST-Datei nicht gefunden."
  28. end
  29. else do
  30.  
  31.     STRING.sFILE  = "Open GST file ..."
  32.     STRING.sGST   = "Look up this symbol:"
  33.     STRING.sERROR = "GST file not found."
  34. end
  35.  
  36. 'QUERY PATH VAR=PATH'
  37.  
  38. R = pragma('D', PATH)
  39.  
  40. GSTFILE = ""
  41.  
  42. call readoptions("SAS/C")
  43.  
  44. if (GSTFILE = "") then
  45.  
  46.     'REQUEST FILE TITLE="' || STRING.sFILE || '" PATH="' || GSTFILE || '" VAR=GSTFILE'
  47.  
  48. if (GSTFILE ~= "") then do
  49.  
  50.     if (exists(GSTFILE)) then do
  51.  
  52.         'REQUEST STRING TITLE="SAS/C" BODY="' || STRING.sGST || '" VAR=SYMBOL'
  53.  
  54.         if ((RC = 0) & (SYMBOL ~= "")) then do
  55.  
  56.             'RUN ASYNC CMD="gst *"' || GSTFILE || '*" *"' || SYMBOL || '*" VERBOSE"'
  57.         end
  58.     end
  59.     else
  60.         'REQUEST PROBLEM="' || STRING.sERROR || '"'
  61. end
  62.  
  63.  
  64. /* ------------------------- END OF YOUR CODE ------------------------ */
  65.  
  66. 'UNLOCK'
  67.  
  68. exit
  69.  
  70. SYNTAX:
  71.  
  72. SAY "Error in line" SIGL ":" ERRORTEXT(RC)
  73.  
  74. 'UNLOCK'
  75.  
  76. /* /// "readoptions" */
  77.  
  78. readoptions: procedure expose CONFIG. STRING. PROJECTNAME OBJFOLDER GSTFILE
  79.  
  80.     /* read compiler-specific options file in project folder (if any exists) */
  81.  
  82.     parse upper arg SOFTWARE
  83.  
  84.     if ((SOFTWARE = "") | (SOFTWARE = "SAS/C") | (SOFTWARE = "SAS/C-GNUMAKE")) then do
  85.  
  86.         if (exists("scoptions")) then do
  87.  
  88.             if open('HANDLE', "scoptions", 'READ') then do
  89.  
  90.                 do until eof('HANDLE')
  91.  
  92.                     DATA = readln('HANDLE')
  93.  
  94.                     if (upper(left(DATA, 12)) = "PROGRAMNAME=") then do
  95.  
  96.                         PROJECTNAME = compress(substr(DATA, 13), '"')
  97.                     end
  98.                     else if (left(DATA, 11) = "OBJECTNAME=") then
  99.  
  100.                         OBJFOLDER = compress(substr(DATA, 12), '"')
  101.  
  102.                     else if (left(DATA, 18) = "GLOBALSYMBOLTABLE=") then
  103.  
  104.                         GSTFILE = compress(substr(DATA, 19), '"')
  105.                 end
  106.  
  107.                 R = close('HANDLE')
  108.             end
  109.         end
  110.     end
  111.  
  112.     return
  113.  
  114. /* /// */
  115.